package com.busfm.net;

import java.util.StringTokenizer;

import com.busfm.model.ResultEntity;
import com.busfm.util.Utilities;

public class StringParser {
	public static ResultEntity parserResult(String body){
		ResultEntity result = new ResultEntity();
		try {
			StringTokenizer token = new StringTokenizer(body,"|");
			result.setResult(Utilities.getInt(token.nextToken()));
			if(token.hasMoreTokens())
				result.setErrorMsg(token.nextToken());
		} catch (Exception e) {
		}
		return result;
	}
}
